import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flutter_flame/component/ScaleSpriteComponent.dart';

import '../../../config/AssetsName.dart';

class SelectorScreenWoodSignComponent extends PositionComponent {
  @override
  Future<void> onLoad() async {
    position = Vector2(-440, -360);
    add(_SelectorScreenWoodSign1());
    add(_SelectorScreenWoodSign2());
    add(_SelectorScreenWoodSign3());
  }
}

class _SelectorScreenWoodSign1 extends ScaleSpriteComponent {
  _SelectorScreenWoodSign1()
    : super(290, Vector2(0, 0), AssetsName.spriteSelectorScreenWoodSign1);
}

class _SelectorScreenWoodSign2 extends ScaleSpriteComponent
    with HoverCallbacks {
  late _SelectorScreenWoodSign2Press highlight =
      _SelectorScreenWoodSign2Press();

  _SelectorScreenWoodSign2()
    : super(290, Vector2(0, 135), AssetsName.spriteSelectorScreenWoodSign2);

  @override
  void onHoverEnter() {
    add(highlight);
    super.onHoverEnter();
  }

  @override
  void onHoverExit() {
    remove(highlight);
    super.onHoverExit();
  }
}

class _SelectorScreenWoodSign3 extends ScaleSpriteComponent {
  _SelectorScreenWoodSign3()
    : super(150, Vector2(0, 190), AssetsName.spriteSelectorScreenWoodSign3);
}

class _SelectorScreenWoodSign2Press extends ScaleSpriteComponent {
  _SelectorScreenWoodSign2Press()
    : super(
        290,
        Vector2.zero(),
        AssetsName.spriteSelectorScreenWoodSign2Press,
      );
}
